package com.hx.demo.controller;


import cn.hutool.core.util.ObjectUtil;
import com.hx.demo.domain.User;
import com.hx.demo.service.IUserSeervice;
import com.hx.demo.util.AjaxResult;
import com.hx.demo.util.UserCacheUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Slf4j
@Controller
public class RegisterController {



    @Autowired
    private IUserSeervice userSeervice;


    @GetMapping("/admin/hello")
    @ResponseBody
    public AjaxResult adminHello(){
        return AjaxResult.success("这个是admin权限");
    }

    @GetMapping("/app/hello")
    @ResponseBody
    public AjaxResult appHello(){
        return AjaxResult.success("这个是APP权限");
    }


    @GetMapping("/user/hello")
    @ResponseBody
    public AjaxResult userHello(){
        return AjaxResult.success("这个是user权限");
    }



    @GetMapping("/register")
    public String login(){
        return "/register";
    }


    @PostMapping("/register")
    @ResponseBody
    public AjaxResult register(String username, String password){

        //TODO 这里写注册逻辑

        return AjaxResult.success();
    }


}
